<?php
$hostname = "localhost";
$username = "rt_user";
$password = "rtpassword";
$strFlg = "";
$database = "rt_widgets";
$dbConnection = mysql_connect($hostname,$username,$password,$strFlg) or die('Can\'t connect'); 
mysql_select_db($database, $dbConnection) or die('can\'t connect to db');
if($_GET['type']=='video'){
    $query = mysql_query('SELECT * FROM tbl_video order by rank limit 10 ' ,$dbConnection) or die(mysql_error());
    $incr=0;
    $record = "";
    $arrRecords = array();
    while($record = mysql_fetch_object($query) ){
      $arrRecords[$incr] = $record;
      $incr++;
    }
    $arrdatavideo = array();
    for($i=0;$i<count($arrRecords);$i++){
        $arrdatavideo[$i]->video = $arrRecords[$i]->link;
        $arrdatavideo[$i]->rank = $arrRecords[$i]->rank;
        $arrdatavideo[$i]->desc = $arrRecords[$i]->description;
    }
    $arrdata = $arrdatavideo;
    echo(json_encode($arrdata));
}
?>
<html>
    <head><title>Map RockeTalk with Orkut</title>
    <script type="text/javascript" src="http://spark.tekmindz.com/cpng/rt/jquerynormal.min.js"></script>
    <script type="text/javascript" src="http://spark.tekmindz.com/cpng/rt/jquerynormal.min.js"></script>
    </head>
    <body>
    <input type="hidden" name="user_id" id="user_id" value="<?php echo($_GET['user_id']); ?>">
        <table>
        <tr>
            <th>RockeTalk Orkut Registration</th>
        </tr>
        <tr>
            <td>
                User-Id
            </td>
            <td>
            <input type="text" name="user_name" id="user_name" value="">
            </td>
           
             <td>
                <div id="user"></div>
            </td>
        </tr>
        <tr>
            <td>
                Password
            </td>
            <td>
            <input type="password" name="password" id="password" value="">
            </td>
            
             <td>
                <div id="pass"></div>
            </td>
        </tr>
        <tr>
            <td>
               &nbsp;&nbsp;
            </td>
            <td>
            <input type="button" name="btn_save" id="btn_save" value="Save">
            </td>
            <td>
                <div id=""></div>
            </td>
        </tr>
        </table>
    </body>
</html>